In common usage today are computer executable functions whose exact mode of operation can vary depending on the nature of the parameters specified by the function. If parameters of one type are input into, and defined for, the function then one operation is performed by the function. Whereas, if a different set of specified parameters are input and defined for the function, then a different operation is performed by the function. Such functions are commonly referred to as generic function calls. A generic function call is a function consisting of a set of methods with a common calling protocol. A generic function computes its value by selecting and calling an appropriate method based on the types of the arguments. Developers can use these generic function calls to conveniently accomplish a vast array of programming tasks.
Each parameter of a generic function is similarly associated with its own set of distinctive requirements. Each generic function call has associated therewith a parameter list that includes, among other things, all the data characteristics (e.g., types, kinds, ranks, etc.) for each parameter of the generic function call. This list defines a “signature” for the specific function. Although disclosed generically here, the principles of the present invention are intended to be broadly applied to all other programming languages that use generic function calls. Other examples include, without limitation, Fortran generic functions and overloaded function templates in C++ and Java, which are sometimes referred to as ad-hoc polymorphic routines.
When a developer compiles a piece of code that calls a generic function, the compiler compares the function used by the developer with a parameter list associated with that function. The compiler will try to match the function call with a specific function with the same signature. The process of matching a function call with a corresponding specific function, or method, is called “overloading resolution”. An error can be detected by the compiler when the overloading resolution cannot find a matching specific function or method. Commonly, since it is not possible to know the intended specific function desired by the programmer, when an error in a generic function call is detected, it is reported by a message such as “No specific function exists” or “There is no matching function”. Details, such as the cause or mode of failure for the generic function call are not provided in conventional technologies.
Although, from this example, it might seem that it would be fairly simple to identify and diagnose the errors in generic function calls, the reader is reminded that the above-mentioned generic function is a very simple example. In other cases, the compilation can result in dozens other error messages. Sorting through each message and individually diagnosing the problem in this manner can be a time-consuming process. Additionally, generic functions can be overloaded with many user-defined functions. Such user-defined generic functions can have an arbitrary number of parameters and are much more complex than the simple intrinsic generic function previously discussed.